{% extends 'user/layout.html.twig' %}

{% block title %}{{ parent() }}{% endblock %}

{% if type == 'question_bank_learning' %}
 {% set pageNav = 'learn' %}
{% endif %}
{% if type == 'question_bank_teaching' %}
  {% set pageNav = 'teach' %}
{% endif %}

{% block main %}

  <ul class="nav nav-pills mbl">
    {% if type == 'question_bank_learning' %}
      <li><a href="{{ path('user_learn', {id:user.id}) }}">{{'site.default.course'|trans}}</a></li>
      <li><a href="{{ path('user_learning_classrooms', {id:user.id}) }}">{{'site.default.classroom.notempty'|trans}}</a></li>
      <li class="active">
        <a href="{{ path('user_question_bank_learn', {id:user.id}) }}">{{'site.default.question.bank'|trans}}</a>
      </li>
    {% endif %}
    {% if type == 'question_bank_teaching' %}
      <li><a href="{{ path('user_teach', {id:user.id}) }}">{{'site.default.course'|trans}}</a></li>
      <li><a href="{{ path('user_teaching_classrooms', {id:user.id}) }}">{{'site.default.classroom.notempty'|trans}}</a></li>
      <li class="active">
        <a href="{{ path('user_question_bank_teach', {id:user.id}) }}">{{'site.default.question.bank'|trans}}</a>
      </li>
    {% endif %}
  </ul>

  {% if exercises %}

    {% include 'user/question-bank-list.html.twig' %}
    <nav class="text-center">
      {{ web_macro.paginator(paginator) }}
    </nav>
  {% else %}
    {% if pageNav == 'learn' %}
      <div class="empty">{{'user.homepage.learning_question_bank.empty'|trans}}</div>
    {% else %}
      <div class="empty">{{'user.homepage.teaching_question_bank.empty'|trans}}</div>
    {% endif %}
  {% endif %}

{% endblock %}